package com.st;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import redis.clients.jedis.Jedis;


@SpringBootApplication
@EnableScheduling//开启定时任务
@MapperScan("com.st.dao")
public class App {
    @Value("${redis.host}")
    private String host;
    @Value("${redis.port}")
    private Integer port;
    @Value("${redis.db}")
    private Integer db;

    @Bean
    public Jedis getJedis(){
        Jedis jedis =new Jedis(host,port);
        jedis.select(db);
        return jedis;
    }
    public static void main(String[] args) {

        SpringApplication.run(App.class);

    }
}
